import LogRocket from 'logrocket';

export function initLogRocket() {
  LogRocket.init('ycmo7j/python-ide');
  const browser = navigator.userAgent;
  const os = navigator.platform;
  const device = /Mobi|Android/i.test(navigator.userAgent) ? 'Mobile' : 'Desktop';

  // 构建用户标识
  const userId = `${browser} | ${os} | ${device}`;

  LogRocket.identify(userId, {
    browser: browser,
    os: os,
    device: device,
    userAgent: navigator.userAgent,
    language: navigator.language,
    platform: navigator.platform,
    screenResolution: `${window.screen.width}x${window.screen.height}`,
    timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
  });
}